package com.zqxq.lottery.api.controller;

import com.zqxq.common.constant.Result;
import com.zqxq.lottery.api.feign.LotteryServerFeignClient;
import com.zqxq.lottery.entity.bo.product.ProductBO;
import com.zqxq.lottery.entity.vo.user.UserProductVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@Api(value = "商品接口",tags = "商品接口")
@RestController
@Slf4j
@RequestMapping(value = "/product", produces = "application/json")
public class ProductController {

    @Autowired
    private LotteryServerFeignClient lotteryServerFeignClient;

    @ApiOperation(value = "商品-查询", notes="商品-查询")
    @PostMapping("/page")
    public Result queryProductPage(ProductBO search){
        return lotteryServerFeignClient.queryProductPage(search);
    }

    @ApiOperation(value = "商品-根据编号查询", notes="商品-根据编号查询")
    @PostMapping("/get")
    public Result getProduct(Long productId){
        return lotteryServerFeignClient.getProduct(productId);
    }

    @ApiOperation(value = "支付-支付页面数据获取", notes="支付-支付页面数据获取")
    @PostMapping("/payDataProcure")
    public Result payDataProcure(Long userId,Long productId){
        return lotteryServerFeignClient.payDataProcure(userId,productId);
    }

    @ApiOperation(value = "支付-提交订单", notes="支付-提交订单")
    @PostMapping("/addProductOrder")
    public Result addProductOrder(UserProductVO vo){
        return lotteryServerFeignClient.addProductOrder(vo);
    }

}
